package com.ks.core.file.oss;

import java.io.File;

public class OSSTest {
    // endpoint以杭州为例，其它region请按实际情况填写
    static String endpoint = "oss-cn-hangzhou.aliyuncs.com";

    // accessKey请登录https://ak-console.aliyun.com/#/查看
    static String accessKeyId = "LTAI141fs0mfKxgT";

    static String accessKeySecret = "6nK7U0TnNQ9hbUvb0D5J9Vdtw8NCgF";

    /**
     * @param args
     */
    public static void main(String[] args) {
        // endpoint=oss-cn-hangzhou.aliyuncs.com
        // endPointForImg=img-cn-hangzhou.aliyuncs.com
        // accessKeyId=WEsHOnka7fmp968b
        // accessKeySecret=QmNoNHHj0sku5GV1NJsSwNEJVWGu3c
        // bucketName=huadaioss
        // accessUrl=image.njhuadai.com

        OSSConfigure OSSConfigure =
                new OSSConfigure(endpoint, accessKeyId, accessKeySecret,
                        "huadaioss", "image.njhuadai.com");

        File file = new File("C:\\Users\\ruirui\\Pictures\\Saved Pictures\\timg.jpg");
        System.out.println(file);

        try {
           /* OSSManageUtil.uploadFile(file, "", null);*/
        } catch (Exception e) {
            e.printStackTrace();
        }

//        // 创建OSSClient实例
//        OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
//
//        // 列举bucket
//        List<Bucket> buckets = ossClient.listBuckets();
//        for (Bucket bucket : buckets)
//        {
//            System.out.println(" - " + bucket.getName());
//        }
//
//        // 关闭client
//        ossClient.shutdown();
    }

}
